﻿using Abp.Domain.Repositories;
using ARchGL.Platform.EntityFrameworkCore;
using System;

namespace ARchGL.Platform.Tests.TestDatas
{
    public class TestDataBuilder
    {
        private readonly HostDbContext _context;
        private readonly int _tenantId;

        public TestDataBuilder(HostDbContext context, int tenantId)
        {
            _context = context;
            _tenantId = tenantId;
        }

        public void Create()
        {
            new TestOrganizationUnitsBuilder(_context, _tenantId).Create();
            new TestSubscriptionPaymentBuilder(_context, _tenantId).Create();
            new TestEditionsBuilder(_context).Create();

            //巨能项目预置数据
            new TestJunengBuilder(_context, _tenantId).Creat();

            _context.SaveChanges();
        }
    }
}
